import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {UserManagerComponent} from './user-manager/user-manager.component';
import {UserDetailComponent} from './user-detail/user-detail.component';
import {UserListComponent} from "./user-list/user-list.component";
import {UserVipComponent} from './user-vip/user-vip.component';
import {AuthGuardGuard} from "../guard/auth-guard.guard";
import {UserComponent} from "./user/user.component";


const userRoutes: Routes = [
  {
    path: 'user',
    component: UserComponent,
    canActivate: [AuthGuardGuard],
    children: [
      {
        path: 'userList',
        component: UserListComponent
      },

      {
        path: 'userVip',
        component: UserVipComponent
      },
      {
        path: 'userManager',
        component: UserManagerComponent
      },
      {
        path: 'userDetail/:id',
        component: UserDetailComponent
      },
    ]
  }
];

@NgModule({
  imports: [RouterModule.forChild(userRoutes)],
  exports: [RouterModule]
})

export class UserRoutingModule {
}
